package com.leo;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;

/**
 * @ClassName ZxingDemo
 * @Description 二维码生成工具
 * @Author wangss
 * @date 2020.11.18 17:31
 * @Version 1.0
 */
public class ZxingDemo extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        AnchorPane root = new AnchorPane();
        Scene scene = new Scene(root);
        primaryStage.setScene(scene);
        primaryStage.setWidth(1000);
        primaryStage.setHeight(600);
        primaryStage.centerOnScreen();
        primaryStage.setTitle("二维码");
        primaryStage.show();

        ImageView iv = QrcodeGeneratorUtils.generatorQRCodeImageFx("我是一直小小鸟", 200, 200);

        ImageView iv2 = QrcodeGeneratorUtils.generatorQRCodeImageFx("我是一直小小鸟", 200, 200, "D:\\work\\idea-workspace\\leo-javafx-parent\\leo-084-javafx-zxing\\src\\main\\resources\\images\\touxiang.png");
        root.getChildren().addAll(iv, iv2);

        AnchorPane.setTopAnchor(iv2, 200d);

    }
}
